<%@ Page Title="Log_LoginLog List" Language="C#" AutoEventWireup="true" CodeBehind="Log_LoginLogList.aspx.cs" Inherits="Youz.CreditRepay.Manage.Log_LoginLogList" %>

<script>
    //loadCSS("assets/plugins/gritter/css/jquery.gritter.css");

    var requireJS = [
        //"assets/plugins/gritter/js/jquery.gritter.min.js"
    ];

    loadJS(requireJS);
    $(function () {
        $('.form_date').datetimepicker({
            language: "zh_CN",
            format: "yyyy-mm-dd",
            autoclose: true,
            todayBtn: true,
            todayHighlight: true,
            pickerPosition: "bottom-left",
            startView: 2,
            minView: 2,
            forceParse: 0
        });
    });
</script>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading" data-original-title>
                <h2><i class="fa fa-align-justify"></i><span style="font-size: 16px; padding-right: 15px;"><%: R(LanguageModule.Log_LoginLog, "Log_LoginLog", "Log_LoginLog") %></span></h2>
                <div class="panel-actions"></div>
            </div>
            <div class="panel-body">
                <div class="alert alert-danger" style="display: none;">
                    <button type="button" class="close" data-dismiss="alert">×</button><strong><i class="fa fa-warning"></i></strong><span class="content"></span>
                </div>
                <form class="form-horizontal">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-3 control-label"><%: R(LanguageModule.M_Common, "LoginAccount", "登录帐号") %></label>
                                <div class="col-md-9">
                        <input type="email" maxlength="45" id="LoginAccount" name="LoginAccount" class="form-control" placeholder="<%: R(LanguageModule.M_Common, "LoginAccount", "登录帐号") %>">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-3 control-label"><%: R(LanguageModule.Log_ErrorLog, "LoginType", "登录类型") %></label>
                                <div class="col-md-9">
                                    <select name="LoginType" id="LoginType" class="form-control">
                                        <option value=""><%: R(LanguageModule.M_Common, "All", "全部") %></option>
                                        <option value="1"><%: R(LanguageModule.M_Common, "Admin", "管理员") %></option>
                                        <option value="2"><%: R(LanguageModule.M_Common, "Member", "会员") %></option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-3 control-label">创建时间</label>
                                <div class="col-md-9">
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        <input type="text" data-date-format="yyyy/mm/dd" id="StartDate" class="form-control form_date" />
                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        <input type="text" data-date-format="yyyy/mm/dd" id="EndDate" class="form-control form_date" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <button type="button" id="btnQuery" name="btnQuery" class="btn btn-default btn-ar btn-primary">
                            <i class="fa fa-search "></i>
                            <%: R(LanguageModule.M_Common, "Query") %>
                        </button>
                    </div>
                </form>
                <table id="table" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%"></table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var dt;

    $(function () {

        dt = $('#table').DataTable({
            "ajax": {
                "url": 'Log/Handlers/Log_LoginLogHandler.ashx?type=list',
                "type": "POST",
                "dataSrc": "data",
                "data": function (d) {
                    d.LoginAccount = $('#LoginAccount').val();
                    d.LoginType = $('#LoginType').val();
                    d.StartDate = $('#StartDate').val();
                    d.EndDate = $('#EndDate').val();
                }
            },
            "columns": [
                    { "data": 'RowIndex', "title": "#" },
                    { "data": 'LoginID', "title": "<%: R(LanguageModule.Log_LoginLog, "LoginID", "标识") %>", visible: false },
                    { "data": 'CreateDate', "title": "<%: R(LanguageModule.Log_LoginLog, "CreateDate", "登录时间") %>" },
                     { "data": 'LoginType', "title": "<%: R(LanguageModule.Log_LoginLog, "LoginType", "登录类型") %>", render: logType },
                    { "data": 'MemberAccount', "title": "<%: R(LanguageModule.M_Common, "LoginAccount", "登录帐号") %>" },
                    { "data": 'IsSuccess', "title": "<%: R(LanguageModule.Log_LoginLog, "IsSuccess", "是否登录成功") %>", render: fYesNo },
                    { "data": 'LoginIP', "title": "<%: R(LanguageModule.Log_LoginLog, "LoginIP", "登录IP") %>" },
                    { "data": 'Memo', "title": "<%: R(LanguageModule.Log_LoginLog, "Memo", "备注") %>" },
                    { "data": 'UserAgent', "title": "<%: R(LanguageModule.Log_LoginLog, "UserAgent", "用户代理信息") %>", render: fText },
            ]
        });
        $('#btnQuery').click(function () {
            if (validateStartDateEndDate($('#StartDate').val(), $('#EndDate').val())) {
                dt.ajax.reload();
            }
        });
    });
</script>
